//
//  MyorderCell.m
//  YouthHostel
//
//  Created by administrator on 16/10/12.
//  Copyright © 2016年 Lorain mac pro. All rights reserved.
//

#import "MyorderCell.h"
#import "Define.h"
@implementation MyorderCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.hotelImg = [[UIImageView alloc]init];
        self.hotelImg.layer.cornerRadius = 10;
        self.hotelImg.clipsToBounds = YES;
        
        self.namelab = [[UILabel alloc]init];
        self.namelab.font = [UIFont systemFontOfSize:20 weight:UIFontWeightHeavy];
        self.namelab.textColor = [UIColor whiteColor];
        self.namelab.textAlignment = NSTextAlignmentCenter;
    
        
        self.timeLab = [[UILabel alloc]init];
        self.timeLab.font = [UIFont systemFontOfSize:15];
        self.timeLab.textColor = [UIColor whiteColor];
        self.timeLab.textAlignment = NSTextAlignmentCenter;
        
        self.viewbg = [[UIView alloc]init];
        self.viewbg.backgroundColor = [UIColor blackColor];
        self.viewbg.alpha = 0.3;
        self.viewbg.layer.cornerRadius = 10;
        self.viewbg.clipsToBounds = YES;
        
        [self.hotelImg addSubview:_viewbg];
        [self.contentView addSubview:_hotelImg];
        [self.contentView addSubview:_namelab];
        [self.contentView addSubview:_timeLab];
    }
    
    
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.hotelImg.frame = CGRectMake(10, 10, WIDTH-20, 160);
    
    self.namelab.frame = CGRectMake(20, 50, WIDTH-40,50);
    
    self.timeLab.frame = CGRectMake(20, 100, WIDTH-40, 30);
    
    self.viewbg.frame = CGRectMake(0, 0, WIDTH-20, 160);
}
//- (void)creat{
//    //数组的初始化
//    _inTimeArr = [NSMutableArray array];
//    _leaveArr = [NSMutableArray array];
//    _nameArr = [NSMutableArray array];
//    _imgArr = [NSMutableArray array];
//    
//    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
//    NSString *inTime = [user objectForKey:@"intime"];
//    NSString *leaveTime = [user objectForKey:@"leavetime"];
//    NSString *name = [user objectForKey:@"roomname"];
//    NSString *hotelimg = [user objectForKey:@"roomimg"];
//    
//    if (_nameArr.count ) {
//        [_inTimeArr addObject:inTime];
//        [_leaveArr addObject:leaveTime];
//        [_nameArr addObject:name];
//        [_imgArr addObject:hotelimg];
//    }
//    
//    [cell.hotelImg sd_setImageWithURL:_imgArr[indexPath.row]];
//    
//    
//    cell.namelab.text = _nameArr[indexPath.row];
//    
//    NSString *time1 = [NSString stringWithFormat:@"预约时间： %@",_inTimeArr[indexPath.row]];
//    cell.timeLab.text = time1;
//    
//}
@end
